import { FormSchema } from '/@/components/Table';
export const bannerData: any = [
  {
    id: 1,
    status: 2,
    order: '1',
    preview: ['https://picsum.photos/id/66/346/216'],
    time: '2022-01-04',
    alt: 'test',
    link: 'test',
  },
];

export const bannerFormSchema: FormSchema[] = [
  {
    label: 'id',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    field: 'type',
    label: '轮播图分类',
    component: 'Select',
    colProps: { span: 22 },
    componentProps: {
      placeholder: '请选择',
      options: [
        { label: '一类', value: '1' },
        { label: '二类', value: '2' },
      ],
    },
  },
  {
    label: '添加封面图',
    field: 'coverUrl',
    component: 'Upload',
    colProps: { span: 22 },
    slot: 'coverUrlSlot',
    rules: [
      {
        required: true,
        validator: async (_rule, value) => {
          if (!value) {
            /* eslint-disable-next-line */
            return Promise.reject('请添加封面图');
          }
          return Promise.resolve();
        },
        trigger: 'change',
      },
    ],
  },
  {
    field: 'alt',
    label: '图片ALT：',
    component: 'Input',
    colProps: { span: 22 },
  },
  {
    field: 'order',
    label: '排序：',
    component: 'Input',
    colProps: { span: 22 },
  },
  {
    field: 'link',
    label: '链接地址：',
    component: 'Input',
    colProps: { span: 22 },
  },
];
